package edu.szte.ovrt.datahandler.core;

import java.io.*;

public abstract class AbstractIOFactory implements IOFactory {
	private String m_fileName;

	protected String getFileName() {
		return m_fileName;
	}

	@Override
	public void setFileName(final String fileName) {
		m_fileName = fileName;
	}

	protected Reader createFileReader() throws FileNotFoundException {
		return new FileReader(getFileName());
	}

	protected Writer createFileWriter() throws FileNotFoundException {
		return new PrintWriter(getFileName());
	}

	abstract public DocumentReader createDocumentReader() throws FileNotFoundException;

	abstract public DocumentWriter createDocumentWriter() throws FileNotFoundException;
}
